#ifndef USERPREFERENCES_H
#define USERPREFERENCES_H

#include <fstream>
#include <boost/archive/text_oarchive.hpp>
#include <boost/archive/text_iarchive.hpp>

#include "AppList.h"

/**
 * Contains the preferences for a given User.
 */
class UserPreferences {
public:
  /**
   * Constructor
   */
  UserPreferences();

  /**
   * Factory that create an instance from a configuration file
   * @param file full path of the configuration file
   */
  //  static UserPreferences* UserPreferencesFactory(std::string file);

  /**
   * Destructor
   */
  ~UserPreferences();

  /**
   * Return a reference on the AppList
   */
  AppList* getAppList();

private:
  friend class boost::serialization::access;
  template<class Archive>
  /**
   * Saves the preference or load preferences to / from an archive
   */
  void serialize(Archive & ar, const unsigned int version) {
    ar & _applist;
  }

  /**
   * The list of all prefered apps
   */
  AppList* _applist;
};

#endif
